/**
 * Copyright © 2020 易久批信息技术有限公司. All rights reserved.
 */
package com.dysm.proxy.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 *
 * @author xiay
 * @since 2020/12/10 10:13 下午
 */
public class RealStarProxyHandler implements InvocationHandler {

    private RealStar realStar;

    public RealStarProxyHandler(RealStar realStar) {
        this.realStar = realStar;
    }
    /**
     *
     */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.err.println(Thread.currentThread().getName() + "演唱会开始前-");
        Object invoke = method.invoke(realStar, args);
        System.err.println(Thread.currentThread().getName() + "演唱会结束后-");
        return invoke;
    }
}
